﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ZhiJian_ReadOnly.aspx.cs" Inherits="syc.ZhiJian.ZhiJian_ReadOnly" %>

<head runat="server">
    <title></title>
</head>
<body>
<link rel="stylesheet" href="jquery.checkbox.css" />
<link rel="stylesheet" href="jquery.safari-checkbox.css" />
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery.checkbox.min.js"></script>
<script type="text/javascript" language="javascript" src="/common.js"></script>
<script type="text/javascript">
    $(document).ready(function() {
        $('input:checkbox:not([safari])').checkbox();
        $('input[safari]:checkbox').checkbox({ cls: 'jquery-safari-checkbox' });
        $('input:radio').checkbox();
    });
						
</script>
    <form id="form1" runat="server">
    <div class="wintop">原材料质量鉴定结果查询</div>  
    <asp:Panel ID="Panel2" runat="server" CssClass="panel">
        供货单位：<asp:DropDownList ID="GongHuo" runat="server" 
            DataSourceID="SqlDataSource2" DataTextField="名称" DataValueField="ID" 
            Width="120px">
        </asp:DropDownList>
        订购产品：<asp:DropDownList ID="ChanPin" runat="server" 
            DataSourceID="SqlDataSource3" DataTextField="品名" DataValueField="ID" 
            Width="120px">
        </asp:DropDownList>
        &nbsp;是否合格<asp:DropDownList ID="HeGe" runat="server" Width="120px">
            <asp:ListItem Value="全部">全部</asp:ListItem>
            <asp:ListItem Value="true">合格</asp:ListItem>
            <asp:ListItem Value="false">不合格</asp:ListItem>
        </asp:DropDownList>
        <br />
        炉号：<asp:TextBox ID="LuHao" runat="server" CssClass="intxt1" Width="120px"></asp:TextBox>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 批次：<asp:TextBox ID="PiCi" runat="server" CssClass="intxt1" Width="120px"></asp:TextBox>
        <br />
        开始日期：<asp:TextBox ID="Date1" runat="server" CssClass="intxt1" Width="120px"></asp:TextBox><img alt="" src="/Icons/29.png" align="middle" onclick="makecalendar(document.getElementById('Date1').value, document.getElementById('Date1'));" />
        结束日期：<asp:TextBox ID="Date2" runat="server" CssClass="intxt1" Width="120px"></asp:TextBox><img alt="" src="/Icons/29.png" align="middle" onclick="makecalendar(document.getElementById('Date2').value, document.getElementById('Date2'));" />
        (根据到货日期设定筛选范围)<br />
        &nbsp;<asp:Button ID="Button3" runat="server" Text="筛 选" CssClass="wsbutton" 
            UseSubmitBehavior="False" onclick="Button_Query_Click" />
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
            ConnectionString="<%$ ConnectionStrings:SCMConnectionString1 %>" 
            SelectCommand="SELECT 0 as [ID], '全部' as [名称] UNION SELECT [ID], [名称] FROM [原料供货单位]"></asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDataSource3" runat="server" 
            ConnectionString="<%$ ConnectionStrings:SCMConnectionString1 %>" 
            SelectCommand="SELECT 0 as [ID], '全部' as [品名] UNION SELECT [ID], [品名] FROM [原料]"></asp:SqlDataSource>
    </asp:Panel>
       <asp:Panel ID="Panel3" runat="server" CssClass="panel2">
        <asp:Label ID="Message" runat="server" Text="·准备就绪" CssClass="prompt"></asp:Label>
    </asp:Panel>
    <div class="gridframe">
        <div class="gridview">
        
            <table border="1" width="100%" cellspacing="0" cellpadding="0" bordercolor="#d0d0d0">
	            <tr>
		            <td class="grid-title">原料送检</td>
		        </tr>
		        <tr>
		            <td class="grid-back">
                        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                            ConnectionString="<%$ ConnectionStrings:SCMConnectionString1 %>" SelectCommand="SELECT     dbo.管材到货明细.ID, dbo.原料供货单位.名称, dbo.原料.品名, dbo.原料.规格, dbo.管材到货明细.炉号, dbo.管材到货明细.批次, dbo.管材到货登记.到货日期, 
                      dbo.管材到货明细.是否合格, dbo.管材到货明细.是否送检, dbo.管材到货明细.送检日期,dbo.管材到货明细.检定日期
                      FROM  dbo.原料供货单位 INNER JOIN
                      dbo.管材到货登记 ON dbo.原料供货单位.ID = dbo.管材到货登记.原料供货单位ID INNER JOIN
                      dbo.管材到货明细 ON dbo.管材到货登记.ID = dbo.管材到货明细.管材到货登记ID INNER JOIN
                      dbo.原料 ON dbo.管材到货明细.原料ID = dbo.原料.ID where dbo.管材到货明细.是否送检='true'" ></asp:SqlDataSource>
                        <asp:GridView ID="GridView1" runat="server" AllowPaging="True"  
                            AutoGenerateColumns="False" CssClass="grid" DataKeyNames="ID" 
                            DataSourceID="SqlDataSource1" 
                            GridLines="None" ondatabound="GridView1_DataBound" 
                            onpageindexchanged="GridView1_PageIndexChanged" AllowSorting="True" 
                            UseAccessibleHeader="False" >
                            <PagerSettings Visible="False" />
                            <RowStyle CssClass="grid-row-normal" />
                            <SelectedRowStyle   CssClass="grid-row-bright" />
                            <Columns>
                                 <asp:TemplateField HeaderText="">
                                    <ItemTemplate>
                                        <asp:Button ID="Button1" runat="server" CommandName="Select" Text="选择" CssClass="hide"/>
                                        <img src="/Icons/online.gif" style="margin-top:2px;" alt="" />
                                    </ItemTemplate>
                                    <HeaderStyle CssClass="grid-header" />
                                    
                                    <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="20px" />
                                </asp:TemplateField>
                                <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False"  
                                    ItemStyle-CssClass="grid" HeaderStyle-CssClass="grid-header"
                                    SortExpression="ID" ItemStyle-Width="80" 
                                    ItemStyle-HorizontalAlign="Center" ReadOnly="True" >
<HeaderStyle CssClass="grid-header"></HeaderStyle>

<ItemStyle HorizontalAlign="Center" CssClass="grid" Width="80px"></ItemStyle>
                                </asp:BoundField>
                                
                                <asp:BoundField DataField="名称" HeaderText="名称" SortExpression="名称" 
                                    ItemStyle-CssClass="grid" HeaderStyle-CssClass="grid-header"
                                    ItemStyle-Width="80" >
<HeaderStyle CssClass="grid-header"></HeaderStyle>

<ItemStyle CssClass="grid" Width="80px"></ItemStyle>
                                </asp:BoundField>
                    
                                <asp:BoundField DataField="品名" HeaderText="品名" SortExpression="品名" 
                                    ItemStyle-CssClass="grid" HeaderStyle-CssClass="grid-header"
                                    ItemStyle-Width="80" >
<HeaderStyle CssClass="grid-header"></HeaderStyle>

<ItemStyle CssClass="grid" Width="80px"></ItemStyle>
                                </asp:BoundField>
                   
                                <asp:BoundField DataField="规格" HeaderText="规格" SortExpression="规格" 
                                    ItemStyle-CssClass="grid" HeaderStyle-CssClass="grid-header"
                                    ItemStyle-Width="80" >
<HeaderStyle CssClass="grid-header"></HeaderStyle>

<ItemStyle CssClass="grid" Width="80px"></ItemStyle>
                                </asp:BoundField>    
                                  
                                <asp:BoundField DataField="炉号" HeaderText="炉号" 
                                    ItemStyle-CssClass="grid" HeaderStyle-CssClass="grid-header" ItemStyle-HorizontalAlign="right"
                                    ItemStyle-Width="80" >
<HeaderStyle CssClass="grid-header"></HeaderStyle>

<ItemStyle HorizontalAlign="Right" CssClass="grid" Width="80px"></ItemStyle>
                                </asp:BoundField>    
                                
                                <asp:BoundField DataField="批次" HeaderText="批次" SortExpression="批次" 
                                    ItemStyle-CssClass="grid" HeaderStyle-CssClass="grid-header"
                                    ItemStyle-HorizontalAlign="center" ItemStyle-Width="80" >
<HeaderStyle CssClass="grid-header"></HeaderStyle>

<ItemStyle HorizontalAlign="Center" CssClass="grid" Width="80px"></ItemStyle>
                                </asp:BoundField>

                              
                                <asp:BoundField DataField="到货日期" HeaderText="到货日期" SortExpression="到货日期"
                                    ItemStyle-CssClass="grid" HeaderStyle-CssClass="grid-header"
                                    ItemStyle-HorizontalAlign="center" ItemStyle-Width="80" 
                                     DataFormatString="{0:d}" >
<HeaderStyle CssClass="grid-header"></HeaderStyle>

<ItemStyle HorizontalAlign="Center" CssClass="grid" Width="80px"></ItemStyle>
                                </asp:BoundField>
                                 <asp:TemplateField HeaderText="是否送检" ItemStyle-CssClass="grid" HeaderStyle-CssClass="grid-header"
                                    ItemStyle-HorizontalAlign="center" ItemStyle-Width="80" Visible="False" >
                                    <ItemTemplate>                                                                           
                                        <asp:CheckBox ID="CheckBox" runat="server"  Checked='<%# Bind("是否送检") %>' ></asp:CheckBox>
                                    </ItemTemplate>

<HeaderStyle CssClass="grid-header"></HeaderStyle>

                                   <ItemStyle HorizontalAlign="Center" CssClass="grid" Width="100px"></ItemStyle>
                                </asp:TemplateField>
                                  
                                <asp:BoundField DataField="送检日期" HeaderText="送检日期" SortExpression="送检日期"
                                    ItemStyle-CssClass="grid" HeaderStyle-CssClass="grid-header"
                                    ItemStyle-HorizontalAlign="center" ItemStyle-Width="80" 
                                     DataFormatString="{0:d}" >
<HeaderStyle CssClass="grid-header"></HeaderStyle>

<ItemStyle HorizontalAlign="Center" CssClass="grid" Width="80px"></ItemStyle>
                                </asp:BoundField >
                                 <asp:BoundField DataField="检定日期" HeaderText="检定日期" SortExpression="检定日期"
                                    ItemStyle-CssClass="grid" HeaderStyle-CssClass="grid-header"
                                    ItemStyle-HorizontalAlign="center" ItemStyle-Width="80" 
                                     DataFormatString="{0:d}" >
<HeaderStyle CssClass="grid-header"></HeaderStyle>

<ItemStyle HorizontalAlign="Center" CssClass="grid" Width="80px"></ItemStyle>
                                </asp:BoundField >
                                 <asp:TemplateField HeaderText="是否合格" ItemStyle-CssClass="grid" HeaderStyle-CssClass="grid-header"
                                    ItemStyle-HorizontalAlign="center" ItemStyle-Width="80" >
                                    <ItemTemplate>                                                                           
                                        <asp:CheckBox ID="CheckBox1" runat="server"  Checked='<%# Bind("是否合格") %>' ></asp:CheckBox>
                                    </ItemTemplate>

<HeaderStyle CssClass="grid-header"></HeaderStyle>

                                   <ItemStyle HorizontalAlign="Center" CssClass="grid" Width="100px"></ItemStyle>
                                </asp:TemplateField>
                                

                            </Columns>
                          </asp:GridView>
		            </td>
	            </tr>
	            <tr>
		            <td>   
		                <table width="100%">
		                    <tr>
		                        <td class="pagebar">
                                    <asp:Button ID="Button_Pager_First" runat="server" Text="" ToolTip="首页" 
                                        CssClass="pageturn-first-b" onclick="Pager_Click" CommandName="--" />
                                    <asp:Button ID="Button_Pager_Prev" runat="server" Text="" ToolTip="上一页" 
                                        CssClass="pageturn-prev-b" onclick="Pager_Click" CommandName="-" />
                                    <input type="button" class="page-split" />第<asp:TextBox ID="TextBox_Pager" runat="server" CssClass="pageturn" 
                                        ontextchanged="Pager_Click"></asp:TextBox>页<input type="button" class="page-split" /><asp:Label ID="Label_Pages" runat="server"></asp:Label><input type="button" class="page-split" />
                                    
                                    <asp:Button ID="Button_Pager_Next" runat="server" Text="" ToolTip="下一页" 
                                        CssClass="pageturn-next-b" onclick="Pager_Click" CommandName="+" />
                                    <asp:Button ID="Button_Pager_Last" runat="server" Text="" ToolTip="末页" 
                                        CssClass="pageturn-last-b" onclick="Pager_Click" CommandName="++" />
                                </td>
                                <td align="right">
                                    <asp:Label ID="Label_Total" runat="server" CssClass="grid_totalrows"></asp:Label>
                                </td>
                            </tr>
                       </table>

		            </td>
	            </tr>
            </table>
            

        </div>
    </div>
    
 </form>
<script type="text/javascript" language="javascript">
    var textboxs = document.getElementsByTagName("input");
    var i;
    for (i = 0; i < textboxs.length; i++) {
        if (textboxs[i].className == "textbox") {
            textboxs[i].onchange = function(e) { this.className = "textbox-changed"; };
            textboxs[i].onfocus = function(e) { this.select(); };
        }
        else if (textboxs[i].className == "pageturn" || textboxs[i].className == "intxt1" || textboxs[i].className == "intxt2") {
            textboxs[i].onfocus = function(e) { this.select(); };
        }

    }
    var rows = document.getElementsByTagName("tr");
    for (i = 0; i < rows.length; i++) {

        if (rows[i].className == "grid-row-normal") {
            rows[i].onmouseover = function() { this.className = "grid-row-bright"; };
            rows[i].onmouseout = function() { this.className = "grid-row-normal"; };
            rows[i].onclick = function() { this.firstChild.firstChild.click(); };
        }
    }
    var tds = document.getElementsByTagName("td");
    for (i = 0; i < tds.length; i++) {
        if (tds[i].className == "detailheader") {
            tds[i].innerHTML = tds[i].innerHTML.replace("*", "<span class=required>*</span>");
        }
    }

</script>
</body>
</html>
